package serializer

import (
	"go-shop-admin/internal/model"
	"time"
)

type AuthRoleVO struct {
	ID   uint   `json:"id" _:"comment:登录账号"`
	Name string `json:"name"   _:"comment:登录账号"`
	Desc string ` json:"desc" `
	//RoleId   uint   ` json:"role_id"  _:"comment:角色表auth_role主键id"`
	Status   uint      ` json:"status" _:"comment:状态:0 禁用 1 正常"`
	CreateAt time.Time ` json:"create_at" `
}

// BuildAuthRole 序列化
func BuildAuthRole(authRole *model.AuthRole) *AuthRoleVO {
	return &AuthRoleVO{
		ID:       authRole.ID,
		Name:     authRole.Name,
		Desc:     authRole.Desc,
		Status:   authRole.Status,
		CreateAt: authRole.CreatedAt,
	}
}
